package com.yundao.service.impl;

import com.yundao.bean.User;
import com.yundao.dao.UserDAO;
import com.yundao.service.IUserService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.transaction.Transactional;
import java.util.List;

/**
 * Created by linving on 2017/3/7.
 */
@Component
public class UserServiceImpl implements IUserService {
    static Logger logger = Logger.getLogger(UserServiceImpl.class);

    @Autowired
    UserDAO usersDAO;

    @Transactional
    public List<User> getAllUser() {
        return usersDAO.getList(User.class);
    }

    @Transactional
    public void save(User user) {
        usersDAO.save(user);
    }
}
